package com.ljf.utility.infra.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.infra.repository.impl.BasisRepositoryImpl;
import com.ljf.common.utils.StringUtil;
import com.ljf.utility.domain.repository.UtilityDatCompileTabulationRepository;
import com.ljf.utility.dto.query.UtilityDatCompileTabulationQuery;
import com.ljf.utility.infra.mapper.UtilityDatCompileTabulationMapper;
import com.ljf.utility.model.UtilityDatCompileTabulation;
import com.ljf.utility.vo.UtilityDatCompileTabulationVO;
import org.springframework.stereotype.Component;

/**
 * 编译目录表  数据访问接口实现
 *
 * @author LJF
 * @since 2025-08-30
 */
@Component
public class UtilityDatCompileTabulationRepositoryImpl extends BasisRepositoryImpl<UtilityDatCompileTabulationMapper, UtilityDatCompileTabulation, UtilityDatCompileTabulationQuery, UtilityDatCompileTabulationVO> implements UtilityDatCompileTabulationRepository {

    @Override
    protected QueryWrapper<UtilityDatCompileTabulation> fillWrapper(UtilityDatCompileTabulationQuery query, boolean sort) throws ServiceException {
        QueryWrapper<UtilityDatCompileTabulation> wrapper = super.fillWrapper(query, sort);
        if (StringUtil.isNotEmpty(query.getNameLike())) {
            wrapper.like(UtilityDatCompileTabulation.COL_NAME, query.getNameLike());
        }
        return wrapper;
    }

}
